/* 应用头部组件样式 */

/* 头部基础样式 */
.app-header {
  background: linear-gradient(135deg, #1976d2 0%, #1e88e5 50%, #42a5f5 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.3);
  backdrop-filter: blur(10px);
  z-index: 100;
  animation: fadeInUp 0.4s ease-out;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.app-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

/* 导航按钮区域 */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
}

.title-text {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  outline: none;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 按钮样式 */
.theme-btn,
.settings-btn {
  font-size: 18px;
}

.settings-btn {
  font-size: 20px;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

.theme-btn:active {
  transform: scale(0.95);
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

.settings-btn:active {
  transform: scale(0.95);
}

/* 动画定义 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 主题适配 */

/* 黑色主题 */
body[data-theme="dark"] .app-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #404040 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .app-header .title-text {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .action-btn,
body[data-theme="dark"] .theme-btn,
body[data-theme="dark"] .settings-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .action-btn:hover,
body[data-theme="dark"] .theme-btn:hover,
body[data-theme="dark"] .settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .nav-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .nav-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* 白色主题 */
body[data-theme="light"] .app-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
  color: #333;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .app-header .title-text {
  color: #333 !important;
  text-shadow: none !important;
}

body[data-theme="light"] .action-btn,
body[data-theme="light"] .theme-btn,
body[data-theme="light"] .settings-btn {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .action-btn:hover,
body[data-theme="light"] .theme-btn:hover,
body[data-theme="light"] .settings-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .nav-btn {
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .nav-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .nav-btn.active {
  background: rgba(0, 0, 0, 0.25);
  color: #333;
  border-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 默认（蓝色）主题 */
body .app-header .title-text,
body[data-theme="blue"] .app-header .title-text {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body .action-btn,
body[data-theme="blue"] .action-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body .action-btn:hover,
body[data-theme="blue"] .action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

body .nav-btn,
body[data-theme="blue"] .nav-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body .nav-btn:hover,
body[data-theme="blue"] .nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

body .nav-btn.active,
body[data-theme="blue"] .nav-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
}

/* 会话列表下拉框样式 */
.session-dropdown {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 350px;
  max-height: 400px;
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
}

.session-dropdown.hidden {
  display: none;
}

.session-dropdown-content {
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1976d2 0%, #1e88e5 100%);
  color: white;
}

.session-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.session-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}

.session-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.session-item:hover {
  background: rgba(25, 118, 210, 0.1);
}

.session-item:last-child {
  border-bottom: none;
}

.session-icon {
  margin-right: 12px;
  font-size: 16px;
}

.session-info {
  flex: 1;
}

.session-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0 0 2px 0;
}

.session-id {
  font-size: 12px;
  color: #666;
  margin: 0;
}

.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #666;
  font-size: 14px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top: 2px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

.error-message {
  text-align: center;
  padding: 24px;
  color: #d32f2f;
  font-size: 14px;
}

.empty-message {
  text-align: center;
  padding: 24px;
  color: #666;
  font-size: 14px;
}

/* 动画 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 深色主题适配 */
body[data-theme="dark"] .session-dropdown {
  background: rgba(42, 42, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .session-name {
  color: #ffffff;
}

body[data-theme="dark"] .session-id {
  color: #cccccc;
}

body[data-theme="dark"] .loading-indicator {
  color: #cccccc;
}

body[data-theme="dark"] .session-item:hover {
  background: rgba(25, 118, 210, 0.2);
}

/* 浅色主题适配 */
body[data-theme="light"] .session-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .session-header {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  color: #333;
}

body[data-theme="light"] .close-btn {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

body[data-theme="light"] .close-btn:hover {
  background: rgba(0, 0, 0, 0.2);
}
